<template lang="html">
  <section class="components-video-intro" v-if="detail !== null">
    <div class="video_introduce_art">
      <h1>{{detail.title}}</h1>
      <p class="video_introduce_art_count"><span>播放量：{{detail.total_views}} </span><span>上传时间：{{detail.created_at.split(' ')[0]}}</span></p>
      <p class="video_introduce_art_art">{{detail.introduction ? detail.introduction : '暂无简介'}}</p>
    </div>
    <div class="video_introduce_remain">
      <span v-if="!detail.hasBought">{{detail.price == 0 ? '免费': '￥' + parseInt(detail.price, 10)*0.01}}</span>
      <span v-else>已购买</span>
      <div class="video_introduce_remain_tri"></div>
      <div class="video_introduce_remain_triright"></div>
    </div>
  </section>
</template>

<script>
export default {
  props:{
    detail: {
      type: Object,
    }
  }
}
</script>

<style lang="scss" scoped>
@import "../../css/config";
$pcolor:#858585;
.components-video-intro{
  position: relative;
  width: 100%;
  padding: 29px 0 38px 0;
  box-sizing: border-box;
  background: #fff;
  margin-top: 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: 15px;
  .video_introduce_art{
    width: 565px;
    margin: 0 auto;
    h1{
      @include text-overflow;
      font-size: 60px;
    }
    .video_introduce_art_count{
      display: inline-block;
      padding-bottom: 16px ;
      margin: 16px 0;
      width: 100%;
      color: $pcolor;
      font-size: 24px;
      border-bottom: 2px solid $pcolor;
      line-height: 1.2;
      font-weight: 100;
    }
    .video_introduce_art_art{
      color: $pcolor;
      font-size: 24px;
      font-weight: 100;
      line-height: 42px;
    }
  }
  .video_introduce_remain{
    width: 66px;
    background: #ff4907;
    text-align: center;
    line-height: 36px;
    color: #fff;
    font-size: 18px;
    letter-spacing: 2px;
    position: absolute;
    top: 0;
    right: 21px;
    white-space: nowrap;
    .video_introduce_remain_tri{
      position: absolute;
      bottom: -25px;
      left: 0;
      width: 0;
      height: 0;
      border-left: 0 solid transparent;
      border-right: 50px solid transparent;
      border-top: 28px solid #ff4907;
    }
    .video_introduce_remain_triright{
      position: absolute;
      bottom: -25px;
      right: 0;
      /*margin-top: 22px;*/
      width: 0;
      height: 0;
      border-left: 50px solid transparent;
      border-right: 0 solid transparent;
      border-top: 28px solid #ff4907;
    }
  }
}
</style>
